package com.spark.auth.controller;

import com.spark.basecommon.api.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fuqiang
 * @Description 测试自动刷新
 * @Date 2020/10/19
 */
@RestController
// 开启动态刷新
@RefreshScope
@RequestMapping("test/")
@Api(tags = "测试中心")
public class TestAutoConfig {

    @Value("${myconfig.is-open}")
    private Boolean isOpen;

    @GetMapping("autoConfig")
    @ApiOperation("测试自动刷新配置")
    public R<Boolean> getOpen(){
        return R.success(isOpen);
    }
}
